package com.wyp.controller.access;

import com.wyp.entity.User;

/**
 * 通过ThreadLocal进行User赋值和取值操作
 *
 * @author: Oliver
 */
public class UserContext {
    private static ThreadLocal<User> userHolder = new ThreadLocal<User>();

    public static void setUser(User user) {
        userHolder.set(user);
    }

    public static User getUser() {
        return userHolder.get();
    }
}
